package cn.edu.scau.cmi.zhonghaozheng.adapter;

import java.util.ArrayList;
import java.util.List;

public class AdapterOfclass extends SortUtil implements SortStudent{

	@Override
	public List sortStudent(List<Student> student) {
		List<Integer> studentIDList = new ArrayList<Integer>();
		List<Student> SortedStudentList = new ArrayList<Student>();
		
		for(int i=0;i<student.size();i++)
		{
			studentIDList.add(student.get(i).getID());
		}
		sortInt(studentIDList);
		for(int i = 0 ; i < studentIDList.size() ; i++) {
			for(int j = 0 ; j < student.size() ; j++) {
				if(studentIDList.get(i) == student.get(j).getID()) {
					SortedStudentList.add(student.get(j));
				}
			}
		}
		return SortedStudentList;
	}
	

}
